<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Customer List for ${Taller.name}</title>
    <meta name="layout" content="main">
  </head>
  <body>
    <br>
    <g:link class="list" action="newCustomer">
      <div class="tabSelected">
        Customer
      </div>
    </g:link>
    <g:link class="list" action="newMechanical">
      <div class="tabNoSelected">
        Mechanical Technician
      </div>
    </g:link>
    <g:link class="list" action="newServicePackage">
      <div class="tabNoSelected">
          Services Packages
      </div>
    </g:link>
    <g:link class="list" action="edit" id="${Taller.id}">
      <div class="tabNoSelected">
       Edit My data
      </div>
    </g:link>  
    <g:link class="list" action="logout" controller="LogIn">
      <div class="tabNoSelected">Log Out</div>
    </g:link>
    <div class="tabContent"> 
      <g:link class="list" action="newCustomer" >
        <div class="tabNoSelected">
          New
        </div>
      </g:link>
      <g:link class="list" action="listCustomer" >
        <div class="tabSelected">
          List
        </div>
      </g:link>
    </div>
    <hr>
    <div>
      <table>
      <thead>
        <tr>

      <g:sortableColumn property="email" title="${message(code: 'customer.email.label', default: 'Email')}" />

      <g:sortableColumn property="identification" title="${message(code: 'customer.identification.label', default: 'Identification')}" />
      
      <g:sortableColumn property="name" title="${message(code: 'customer.name.label', default: 'Name')}" />

      
      <g:sortableColumn property="address" title="${message(code: 'customer.address.label', default: 'Address')}" />

      <g:sortableColumn property="phoneNumber" title="${message(code: 'customer.phoneNumber.label', default: 'Phone Number')}" />

      <th><g:message code="customer.repairShop.label" default="Repair Shop" /></th>

      </tr>
      </thead>
      <tbody>
      <g:each in="${customerInstanceList}" status="i" var="customerInstance">
        <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

        <td><g:link action="editCustomer" id="${customerInstance.id}">${fieldValue(bean: customerInstance, field: "email")}</g:link></td>

        <td>${fieldValue(bean: customerInstance, field: "identification")}</td>

        <td>${fieldValue(bean: customerInstance, field: "name")}</td>

        <td>${fieldValue(bean: customerInstance, field: "address")}</td>

        <td>${fieldValue(bean: customerInstance, field: "phoneNumber")}</td>

        <td>${fieldValue(bean: customerInstance, field: "repairShop.name")}</td>

        </tr>
      </g:each>
      </tbody>
    </table>
    </div>
  </body>
</html>
